package com.dibang.app.operation.model.impl;

import android.support.annotation.NonNull;

import com.dibang.app.bean.GroupSelectNumberItem;
import com.dibang.app.operation.model.abs.IssueGroupModel;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by wxl on 2019/7/24.
 *
 */

public class IssueGroupModelImpl implements IssueGroupModel {

    @NonNull
    @Override
    public List<GroupSelectNumberItem> generateNumbers(int num, int selectedNum) {
        List<GroupSelectNumberItem> numberItems = new ArrayList<>();
        for (int i = 0; i < num; i++) {
            GroupSelectNumberItem item = new GroupSelectNumberItem();
            item.num = i + 1;
            item.select = selectedNum == item.num;
            numberItems.add(item);
        }
        return numberItems;
    }


    @NonNull
    @Override
    public List<GroupSelectNumberItem> generateRemarks(int selectedPosition) {

        List<GroupSelectNumberItem> remarks = new ArrayList<>();

        GroupSelectNumberItem item0 = new GroupSelectNumberItem();
        item0.remark = "无";
        remarks.add(item0);

        GroupSelectNumberItem item1 = new GroupSelectNumberItem();
        item1.remark = "有老人";
        remarks.add(item1);

        GroupSelectNumberItem item2 = new GroupSelectNumberItem();
        item2.remark = "有孕妇";
        remarks.add(item2);

        GroupSelectNumberItem item3 = new GroupSelectNumberItem();
        item3.remark = "有儿童";
        remarks.add(item3);

        GroupSelectNumberItem item4 = new GroupSelectNumberItem();
        item4.remark = "有宠物";
        remarks.add(item4);

        GroupSelectNumberItem item5 = new GroupSelectNumberItem();
        item5.remark = "走高速，费用平摊";
        remarks.add(item5);

        GroupSelectNumberItem item6 = new GroupSelectNumberItem();
        item6.remark = "其他";
        remarks.add(item6);


        if(selectedPosition < remarks.size()) {
            remarks.get(selectedPosition).select = true;
        }

        return remarks;
    }
}
